<template>
	<view class="content">
		<uni-list v-for="(item,index) in list" :key='item.id'>
			<uni-list-chat :title="item.name" :note="item.department" @click="toChat()" :thumb="item.icon"
				thumbSize="lg" :clickable="true"></uni-list-chat>
		</uni-list>
		<button @click='toComments' class='btn'  type="primary">查看评论</button>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				"list": [],
				message: "",
				offset: [20, -35],
				absolute: 'rightTop'
			}
		},

		onLoad() {
			uni.request({
				url: 'http://localhost:8090/freshmenapp/user/list',
				method: 'POST',
				data: {},
				success: res => {
					if (res.data.success) {
						console.log(res.data);
						this.list = res.data.list
						uni.showToast({
							title: '成功',
							duration: 60000
						})

					} else {
						this.list = []
						uni.showToast({
							title: '失败',
							duration: 60000
						})
					}
				}
			})
		},
		fail: () => {
			uni.showToast({
				tltle: '网络错误',
				icon: 'none',
				duration: 60000
			})
		},
		complete: () => {},
		methods: {
			toChat() {
				uni.navigateTo({
					url:'./chat'

				})
			},
			toComments(){
				uni.navigateTo({
					url: './comments',
				});
			}
		}
	}
</script>

<style>
	.content {
		/* display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center; */
		padding: 20px;
		font-size: 14px;
		line-height: 24px;
		/* position: relative; */
	}
	.bytn{
		display:flex
		font-size 20px;
	}
</style>